package com.example.administrator.nl.activity.news;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.nl.R;
import com.example.administrator.nl.adapter.NewAdapter;
import com.example.administrator.nl.base.BaseActivity;
import com.example.administrator.nl.bean.NewsBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 消息通知页面
 *
 * @author yuan
 */
public class NewsActivity extends BaseActivity {

    @BindView(R.id.tv_title)
    TextView tv_title;

    @BindView(R.id.iv_finish)
    ImageView iv_finish;

    @BindView(R.id.recycler_view)
    RecyclerView recycler_view;

    private NewAdapter newAdapter;

    private List<NewsBean> newsBeanList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        listener();
    }

    @Override
    public int getContentView() {
        return R.layout.activity_news;
    }

    @Override
    public void init() {
        tv_title.setText("系统消息");
        recycler_view.setLayoutManager(new LinearLayoutManager(this));
        newsBeanList = getData();
        newAdapter = new NewAdapter(R.layout.item_system_news_recycle, newsBeanList);
        recycler_view.setAdapter(newAdapter);
    }


    private void listener() {
        iv_finish.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    public List<NewsBean> getData() {
        newsBeanList =new ArrayList<>();
        newsBeanList.add(new NewsBean());
        newsBeanList.add(new NewsBean());
        newsBeanList.add(new NewsBean());
        newsBeanList.add(new NewsBean());
        newsBeanList.add(new NewsBean());
        newsBeanList.add(new NewsBean());
        return newsBeanList;
    }
}
